public class Main {
    public static void main(String[] args) {
        int[] arr={1,2,3,4};
        String ret=func(arr);
        System.out.println(ret);
    }
    public static String func(int[] arr1){
        assert(arr1!=null);
        String arr2 = "[";
        for (int i = 0; i < arr1.length; i++) {
            arr2=arr2+arr1[i];
            if(i<arr1.length-1){
                arr2=arr2+",";
            }
        }
        arr2=arr2+"]";
        return arr2;
    }
}